package com.ruoyi.ncpsy.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ncpsy.mapper.NcpsyProductSaleMapper;
import com.ruoyi.ncpsy.domain.NcpsyProductSale;
import com.ruoyi.ncpsy.service.INcpsyProductSaleService;

/**
 * 上架销售Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-13
 */
@Service
public class NcpsyProductSaleServiceImpl implements INcpsyProductSaleService 
{
    @Autowired
    private NcpsyProductSaleMapper ncpsyProductSaleMapper;

    /**
     * 查询上架销售
     * 
     * @param id 上架销售主键
     * @return 上架销售
     */
    @Override
    public NcpsyProductSale selectNcpsyProductSaleById(Long id)
    {
        return ncpsyProductSaleMapper.selectNcpsyProductSaleById(id);
    }

    /**
     * 查询上架销售列表
     * 
     * @param ncpsyProductSale 上架销售
     * @return 上架销售
     */
    @Override
    public List<NcpsyProductSale> selectNcpsyProductSaleList(NcpsyProductSale ncpsyProductSale)
    {
        return ncpsyProductSaleMapper.selectNcpsyProductSaleList(ncpsyProductSale);
    }

    /**
     * 新增上架销售
     * 
     * @param ncpsyProductSale 上架销售
     * @return 结果
     */
    @Override
    public int insertNcpsyProductSale(NcpsyProductSale ncpsyProductSale)
    {
        ncpsyProductSale.setCreateTime(DateUtils.getNowDate());
        return ncpsyProductSaleMapper.insertNcpsyProductSale(ncpsyProductSale);
    }

    /**
     * 修改上架销售
     * 
     * @param ncpsyProductSale 上架销售
     * @return 结果
     */
    @Override
    public int updateNcpsyProductSale(NcpsyProductSale ncpsyProductSale)
    {
        ncpsyProductSale.setUpdateTime(DateUtils.getNowDate());
        return ncpsyProductSaleMapper.updateNcpsyProductSale(ncpsyProductSale);
    }

    /**
     * 批量删除上架销售
     * 
     * @param ids 需要删除的上架销售主键
     * @return 结果
     */
    @Override
    public int deleteNcpsyProductSaleByIds(Long[] ids)
    {
        return ncpsyProductSaleMapper.deleteNcpsyProductSaleByIds(ids);
    }

    /**
     * 删除上架销售信息
     * 
     * @param id 上架销售主键
     * @return 结果
     */
    @Override
    public int deleteNcpsyProductSaleById(Long id)
    {
        return ncpsyProductSaleMapper.deleteNcpsyProductSaleById(id);
    }
}
